/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import componenten.Database;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UnsupportedLookAndFeelException;
import main.ConnectieMaken;

/**
 *
 * @author misja
 */
public class HoofdScherm extends javax.swing.JFrame {

    /**
     * Creates new form HoofdScherm
     */
    public HoofdScherm() {
        initComponents();
    }

    private void toevoegenPaneel(JPanel paneel) {
        //Remove the old pannel
        this.remove(pContainer);

        //Set the size and the position of the panel to the possion we gave to the original pannel.
        paneel.setBounds(pContainer.getBounds());

        //Add the panel to the frame.
        add(paneel);
        //Repaint the frame so we can see the new panel
        paneel.validate();
        paneel.repaint();
        pContainer = paneel;

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pContainer = new javax.swing.JPanel();
        btnLocatie = new javax.swing.JButton();
        btnToernooi = new javax.swing.JButton();
        btnLid = new javax.swing.JButton();
        btnMasterclass = new javax.swing.JButton();
        btnMaster = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("FULLHOUSE");

        pContainer.setBackground(new java.awt.Color(112, 112, 112));
        pContainer.setLayout(null);

        btnLocatie.setText("Locatie");
        btnLocatie.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLocatieActionPerformed(evt);
            }
        });

        btnToernooi.setText("Toernooi");
        btnToernooi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnToernooiActionPerformed(evt);
            }
        });

        btnLid.setText("Lid");
        btnLid.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLidActionPerformed(evt);
            }
        });

        btnMasterclass.setText("Masterclass");
        btnMasterclass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMasterclassActionPerformed(evt);
            }
        });

        btnMaster.setText("Master");
        btnMaster.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMasterActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 800, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnLocatie)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnToernooi)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLid)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnMaster)
                        .addGap(5, 5, 5)
                        .addComponent(btnMasterclass)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnMasterclass)
                    .addComponent(btnLid)
                    .addComponent(btnToernooi)
                    .addComponent(btnLocatie)
                    .addComponent(btnMaster))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pContainer.getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnLocatieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLocatieActionPerformed
        LocatieOverzicht paneel = new LocatieOverzicht();
        this.toevoegenPaneel(paneel);
        setTitle("FULLHOUSE - LOCATIE");
    }//GEN-LAST:event_btnLocatieActionPerformed

    private void btnToernooiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnToernooiActionPerformed
        ToernooiOverzichtf paneel = new ToernooiOverzichtf();
        this.toevoegenPaneel(paneel);
        setTitle("FULLHOUSE - TOERNOOI");
    }//GEN-LAST:event_btnToernooiActionPerformed

    private void btnLidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLidActionPerformed
        LidOverzichtf paneel = new LidOverzichtf();
        this.toevoegenPaneel(paneel);
        setTitle("FULLHOUSE - LID");
    }//GEN-LAST:event_btnLidActionPerformed

    private void btnMasterclassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMasterclassActionPerformed
        MasterclassOverzicht paneel = new MasterclassOverzicht();
        this.toevoegenPaneel(paneel);
        setTitle("FULLHOUSE - MASTERCLASS");
    }//GEN-LAST:event_btnMasterclassActionPerformed

    private void btnMasterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMasterActionPerformed
        MasterOverzichtf paneel = new MasterOverzichtf();
        this.toevoegenPaneel(paneel);
        setTitle("FULLHOUSE - MASTER");
    }//GEN-LAST:event_btnMasterActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) throws UnsupportedLookAndFeelException {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(HoofdScherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(HoofdScherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(HoofdScherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>




        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new HoofdScherm().setVisible(true); 
            }
        });

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnLid;
    private javax.swing.JButton btnLocatie;
    private javax.swing.JButton btnMaster;
    private javax.swing.JButton btnMasterclass;
    private javax.swing.JButton btnToernooi;
    private javax.swing.JPanel pContainer;
    // End of variables declaration//GEN-END:variables
}
